summaryrefslogtreecommitdiff
path: root/app/[lng]/admin/layout.tsx
diff options
context:
space:
mode:
authorjoonhoekim <26rote@gmail.com>2025-08-27 08:24:58 +0000
committerjoonhoekim <26rote@gmail.com>2025-08-27 08:24:58 +0000
commite2ed31dd0112dc3bede53ceef9b957d2810e141e (patch)
tree9727511febf5b51ee897b0ae2f24f6b68a95cbad /app/[lng]/admin/layout.tsx
parent026ce088c638b50f493fe9aedf36e0659cb368c3 (diff)
(김준회) 임시 관리자 페이지 - EDP 데이터 수동 관리 추가 및 세션검증 추가
Diffstat (limited to 'app/[lng]/admin/layout.tsx')
-rw-r--r--app/[lng]/admin/layout.tsx34
1 files changed, 34 insertions, 0 deletions
diff --git a/app/[lng]/admin/layout.tsx b/app/[lng]/admin/layout.tsx
new file mode 100644
index 00000000..918a8554
--- /dev/null
+++ b/app/[lng]/admin/layout.tsx
@@ -0,0 +1,34 @@
+import { getServerSession } from "next-auth"
+import { authOptions } from "@/app/api/auth/[...nextauth]/route"
+import { redirect } from "next/navigation"
+
+export default async function AdminLayout({
+ children,
+}: {
+ children: React.ReactNode
+}) {
+ const session = await getServerSession(authOptions)
+
+ // 세션이 없거나 domain이 'evcp'가 아닌 경우 접근 거부
+ if (!session?.user || session.user.domain !== 'evcp') {
+ redirect('/en/evcp')
+ }
+
+ return (
+ <div className="min-h-screen bg-gray-50">
+ <div className="bg-white shadow-sm border-b">
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8">
+ <div className="flex justify-between items-center py-4">
+ <h1 className="text-2xl font-bold text-gray-900">임시 관리자 페이지</h1>
+ <div className="text-sm text-gray-600">
+ {session.user.name} ({session.user.email})
+ </div>
+ </div>
+ </div>
+ </div>
+ <div className="max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8">
+ {children}
+ </div>
+ </div>
+ )
+}